package com.itheima;

import com.itheima.pojo.Teacher;
import com.itheima.pojo.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-05 09:22
 * @description 无参构造 但是有属性需要注入
 */
public class Test02 {


    public static void main(String[] args) {

        //创建spring容器对象 给出配置文件的地址
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");


        //获取名字叫做 teacher01对象


        Teacher teacher01 = (Teacher) context.getBean("teacher01");
        System.out.println("获取的对象:"+teacher01);

    }


}
